<% @page_title = @section.title -%>
<% @inner_page = true if @section.description -%>

<%= top_nav @page_title, [@section.collection] + @section.lineage %><br/>

<h2 <%="id='inner-pins'" if @inner_page%> >
  <%= @section.section_no %> - <%=@section.title%>
</h2>

<p id="content">
  <p id="content">
	  <%=@section.description%>
  </p>

  <% unless @subsections.empty? -%>
    <!-- list subsections -->
    <div class="books-index">
      <ul>
      <% @subsections.each do |s| -%>
        <li><%= link_to "#{s.section_no}-#{s.title}", section_path(s) %></li>
      <% end -%>
      </ul>
    </div>
    <%=will_paginate @subsections, :prev_label=>t('navigate.previous_page'),
      :next_label=>t('navigate.next_page'), :param_name=>'page'%>
    <!-- end of list subsections -->
  <% end -%>


  <% unless @documents.empty? -%>
    <!-- list documents -->
    <div class="books-index">
      <ul>
        <% @documents.each do |d| -%>
          <li><%= link_to d.snippet, document_path(d) %></li>
        <% end -%>
      </ul>
    </div>
    <%=will_paginate @documents, :prev_label=>t('navigate.previous_page'),
      :next_label=>t('navigate.next_page'), :param_name=>'page'%>
    <!-- end of list documents -->
  <% end -%>

  <p class="bottom_navigation">
    <%= t('navigate.back_to')%>
    <% if @section.parent -%>
      <%= link_to @section.parent.title, section_path(@section.parent), :id=>'backToPrevPage' %>
    <% else -%>
      <%= link_to @section.collection.title, collection_path(@section.collection), :id=>'backToPrevPage' %>
    <% end -%>
  </p>
  <%= link_to t('collection.all'), collections_path, :id=>"pageTop" %>
</p>

